package com.shuoyue.ycgk.ui.news;

import android.widget.ImageView;

import androidx.annotation.Nullable;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseViewHolder;
import com.shuoyue.ycgk.R;
import com.shuoyue.ycgk.base.baseadapter.AppBaseQuickAdapter;
import com.shuoyue.ycgk.entity.News;

import java.util.List;

public class NewsAdapter extends AppBaseQuickAdapter<News> {
    public NewsAdapter(@Nullable List<News> data) {
        super(R.layout.item_news, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, News item) {
        helper.addOnClickListener(R.id.lay_all);
        helper.setText(R.id.title, item.getTitle());
        helper.setText(R.id.time, item.getCreateTime());
//        helper.setVisible(R.id.tag, item.getBrowseNum() > 1000);
        Glide.with(mContext).load(item.getCoverUrl()).error(R.mipmap.img_loading_gray).into((ImageView) helper.getView(R.id.img));
    }


}
